package com.briup.day26;

import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.SocketException;

public class Test_UDPReceive {
    public static void main(String[] args) throws Exception {
        int port = 8888;
        byte[] buff = new byte[1024];
        DatagramSocket  socket = new DatagramSocket(port);
        DatagramPacket packet = new DatagramPacket(buff,0,buff.length);
        socket.receive(packet);
        System.out.println("数据读取完毕");
        socket.close();
    }
}
